<template>
    <div>
        <van-nav-bar :title="userSend[0].username" left-text="返回" left-arrow @click-left="onClickLeft" />
        <div style="border: 1px solid #ccc;" v-for="item in userSend" :key="item.s_con_id">
            <div class="userInfo">
                <img :src="item.buddha" alt="">
                <div class="name">{{ item.username }}</div>
                <div class="school">{{ item.school }}</div>
            </div>
            <div class="count">{{ item.s_content }}</div>
            <div class="time">{{ item.s_time }}</div>
        </div>
    </div>
</template>

<script>
import { getUsersendAPI } from '../api/API'
export default {
    name: 'userSend',
    data() {
        return {
            userSend: ''
        }
    },
    methods: {
        onClickLeft() {
            this.$router.push('/find')
        }
    },
    mounted() {
        getUsersendAPI(sessionStorage.getItem('sendID')).then((res) => {
            console.log(res.data.data);
            this.userSend = res.data.data;
        })
    }
}
</script>

<style scoped>
.userInfo {
    display: flex;
    align-items: center;
}

img {
    width: 40px;
    height: 40px;
    border-radius: 100px;
    margin: 10px;
}

.name {
    font-weight: 700;
}

.count {
    margin: 10px;
    font-size: 20px;
}

.school {
    margin-left: 100px;
    color: #ccc;
}

.time {
    margin-right: 30px;
    margin-left: 50vw;
    color: #aaa;
}
</style>